package com.tina.entity;

import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * <p>
 * 
 * </p>
 *
 * @author Tina
 * @since 2020-07-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class Employee implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 员工id
     */
    private Integer empId;

    /**
     * 员工姓名
     */
    @Valid
    @NotBlank(message = "姓名不能为空")
    private String empName;

    /**
     * 员工年龄
     */
    @Valid
    @NotNull(message = "年龄不能为空")
    private Integer empAge;

    /**
     * 员工性别 0女 1男
     */
    @Valid
    @NotNull(message = "性别不能为空")
    @Range(min = 0,max = 1,message = "性别只能输入0(‘女’)跟1(‘男’)")
    private Integer empSex;

    /**
     * 员工地址
     */
    @Valid
    @NotBlank(message = "地址不能为空")
    private String empAddress;


}
